$(function() {
	initStockList();
});

function initStockList(){
	$('#west .west_menu').append('<div class="stock_li" url="customer.html">客户管理</div>');
	$('#west .west_menu').append('<div class="stock_li" url="print.html">出货打印</div>');
	$('#west .west_menu').append('<div class="stock_li" url="query.html">历史查询</div>');
	$('.stock_li').accordion();
	$('.stock_li').click(function(){
		addTabs($(this).attr("url"),$(this).html());
	});
}

function addTabs(url,text){
	var pp = $('#mainTitle').tabs('exists',text);
	if(!pp){
		$('#mainTitle').tabs('add',{
			title:text,
			content:'<iframe frameborder="0" style="width:100%;height:99%;" src="'+""+url+'"></iframe>',
			closable:true
		});
	}
}